//
//  DKRegistreRuleView.m
//  DanKU
//
//  Created by 吴斌 on 2023/10/13.
//

#import "DKRegistreRuleView.h"

@implementation DKRegistreRuleView
-(instancetype)init{
    if(self == [super init]){
        self.backgroundColor = UIColor.whiteColor;
        self.layer.cornerRadius = 50;
        self.clipsToBounds = YES;
        [self dk_addSubView];
    }
    return self;
}
- (void)dk_addSubView{
    UILabel *dk_RegisterHeadLab = [[UILabel alloc] init];
    dk_RegisterHeadLab.textColor = DK_Hex(@"#333333");
    dk_RegisterHeadLab.font = DK_FONT_Semibold(17);
    dk_RegisterHeadLab.text = @"Tips";
    [self addSubview:dk_RegisterHeadLab];
    [dk_RegisterHeadLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(@(DK_IsWidthScale(30)));
        make.height.equalTo(@(DK_IsWidthScale(24)));
        make.centerX.equalTo(self);
    }];
    //alert
    UILabel *dk_RegisterAlertLab = [[UILabel alloc] init];
    dk_RegisterAlertLab.textColor = DK_Hex(@"#333333");
    dk_RegisterAlertLab.font = DK_FONT_Regular(14);
    dk_RegisterAlertLab.text = @"If you can not recieve SMS verification code, try voice verificaition, please pay attention to your phone calls.";
    [self addSubview:dk_RegisterAlertLab];
    [dk_RegisterAlertLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(28)));
        make.right.equalTo(@(-DK_IsWidthScale(28)));
        make.top.equalTo(dk_RegisterHeadLab.mas_bottom).offset(DK_IsWidthScale(19));
        make.height.equalTo(@(DK_IsWidthScale(60)));
    }];
    //sms verfication
    UIButton * dk_smsVerficationBtn = [[UIButton alloc] init];
    [dk_smsVerficationBtn setTitle:@"Voice verification" forState:UIControlStateNormal];
    [dk_smsVerficationBtn setTitleColor:DK_Hex(@"#FFFFFF") forState:UIControlStateNormal];
    dk_smsVerficationBtn.titleLabel.font = DK_FONT_Semibold(16);
    [dk_smsVerficationBtn setBackgroundColor:DK_Hex(@"#4566FF")];
    dk_smsVerficationBtn.layer.cornerRadius = DK_IsWidthScale(25);
    dk_smsVerficationBtn.clipsToBounds = YES;
    [dk_smsVerficationBtn addTarget:self action:@selector(goSmsVerfication) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:dk_smsVerficationBtn];
    [dk_smsVerficationBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(30)));
        make.right.equalTo(@(-DK_IsWidthScale(30)));
        make.height.equalTo(@(DK_IsWidthScale(50)));
        make.bottom.equalTo(@(-DK_IsWidthScale(40)));
    }];
    //voice verfication
    UIButton * dk_voiceVerficationBtn = [[UIButton alloc] init];
    [dk_voiceVerficationBtn setTitle:@"Voice verification" forState:UIControlStateNormal];
    [dk_voiceVerficationBtn setTitleColor:DK_Hex(@"#FFFFFF") forState:UIControlStateNormal];
    dk_voiceVerficationBtn.titleLabel.font = DK_FONT_Semibold(16);
    [dk_voiceVerficationBtn setBackgroundColor:DK_Hex(@"#4566FF")];
    dk_voiceVerficationBtn.layer.cornerRadius = DK_IsWidthScale(25);
    dk_voiceVerficationBtn.clipsToBounds = YES;
    [dk_voiceVerficationBtn addTarget:self action:@selector(goVoiceVerfication) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:dk_voiceVerficationBtn];
    [dk_voiceVerficationBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(30)));
        make.right.equalTo(@(-DK_IsWidthScale(30)));
        make.height.equalTo(@(DK_IsWidthScale(50)));
        make.bottom.equalTo(dk_smsVerficationBtn.mas_top).offset(DK_IsWidthScale(10));
    }];
    //close
    UIButton * dk_LoginCloseBtn = [[UIButton alloc] init];
    [dk_LoginCloseBtn setBackgroundImage:DK_GetImage(@"dk_LoginAgreementClose") forState:UIControlStateNormal];
    [dk_LoginCloseBtn addTarget:self action:@selector(goCancle) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:dk_LoginCloseBtn];
    [dk_LoginCloseBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(@(DK_IsWidthScale(20)));
        make.right.equalTo(@(-DK_IsWidthScale(20)));
        make.height.equalTo(@(DK_IsWidthScale(17)));
        make.width.equalTo(@(DK_IsWidthScale(17)));
    }];
}
+ (void)dk_ShowRegistreRuleViewComplete:(void(^)(void))complete{
    
}

@end
